package com.v2.k22;


import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class MyMethodInterceptor implements MethodInterceptor {

	@Override
	public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
		System.out.println("目标方法调用前。。。");
		//注意这里的方法调用，不是用反射哦！！！
		Object obj = methodProxy.invokeSuper(o, objects);
		System.out.println("目标方法调用后。。。");
		return obj;
	}
}
